package com.sample.service.datastore.ex3;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;


public class QueryTest {

    static DatastoreService store = DatastoreServiceFactory.getDatastoreService();

    public static void putData() {

        Entity goods1 = new Entity("Goods");
        goods1.setProperty("cd", 1);
        goods1.setProperty("name", "パソコン");
        goods1.setProperty("price", 100000);
        goods1.setProperty("date", "2011/05/01");
        store.put(goods1);

        Entity goods2 = new Entity("Goods");
        goods2.setProperty("cd", 2);
        goods2.setProperty("name", "プリンタ");
        goods2.setProperty("price", 50000);
        goods2.setProperty("date", "2011/05/02");
        store.put(goods2);

        Entity goods3 = new Entity("Goods");
        goods3.setProperty("cd", 3);
        goods3.setProperty("name", "マウス");
        goods3.setProperty("price", 5000);
        goods3.setProperty("date", "2011/05/03");
        store.put(goods3);

        Entity goods4 = new Entity("Goods");
        goods4.setProperty("cd", 4);
        goods4.setProperty("name", "キーボード");
        goods4.setProperty("price", 8000);
        goods4.setProperty("date", "2011/05/04");
        store.put(goods4);

        Entity goods5 = new Entity("Goods");
        goods5.setProperty("cd", 5);
        goods5.setProperty("name", "USBメモリ");
        goods5.setProperty("price", 3000);
        goods5.setProperty("date", "2011/05/05");
        store.put(goods5);

        Entity goods6 = new Entity("Goods");
        goods6.setProperty("cd", 6);
        goods6.setProperty("name", "スピーカー");
        goods6.setProperty("price", 2000);
        goods6.setProperty("date", "2011/05/06");
        store.put(goods6);

        Entity goods7 = new Entity("Goods");
        goods7.setProperty("cd", 7);
        goods7.setProperty("name", "ディスプレイ");
        goods7.setProperty("price", 30000);
        goods7.setProperty("date", "2011/05/07");
        store.put(goods7);
    }

}
